<div class="layui-header">
    <div class="layui-logo">交易平台</div>
    <!-- 头部区域（可配合layui 已有的水平导航） -->
    <ul class="layui-nav layui-layout-left">
        <li class="layui-nav-item"><a href="/product/index">产品大厅</a></li>
        <li class="layui-nav-item"><a href="/userProduct/index">我的产品</a></li>
    </ul>
    <ul class="layui-nav layui-layout-right">
        <li class="layui-nav-item">
            <a href="javascript:;">
                钱包剩余余额:${user.money!}
            </a>
            <dl class="layui-nav-child">
                <dd><a target="_blank" href="/userPay">钱包充值</a></dd>
                <dd><a target="_blank" href="/userTransfer">钱包取现</a></dd>
            </dl>
        </li>
        <li class="layui-nav-item">
            <a href="javascript:;">
                ${user.username!}
            </a>
            <dl class="layui-nav-child">
                <dd><a target="_blank" href="/userIndex">个人中心</a></dd>
                <dd><a onclick="logout()" href="javascript:;">账户注销</a></dd>
            </dl>
        </li>
    </ul>
</div>

<script>
    function logout(){
        var layer = layui.layer;
        layer.confirm('是否要注销账户?',{icon:3},function () {
            $.post("/logout",res=>{
                console.log("logout success");
                location.href = '/loginPage';
            });
        })

    }
</script>